import builtins

print = None
input = None

class UI:
    """
    管理当前使用的UI。
    """
    ui = None

    @classmethod
    def setCurrentUI(cls,ui) -> None:
        global print
        global input

        cls.ui = ui

        print = cls.ui.print
        input = cls.ui.input
        

class Desktop:
    """
    常见的桌面输入输出方式。
    """
    def __init__(self) -> None:
        if not UI.ui: UI.setCurrentUI(self)

    def print(self,*argv,**kwarg) -> None:
        builtins.print(*argv,**kwarg)

    def input(self,*argv,**kwarg) -> str:
        return builtins.input(*argv,**kwarg)
    
def endPassage(): print()

if (__name__ != "__main__"): Desktop()


    
